<template>
	<view class="count p-20">
		<view v-for="(item,index) in list" :key="index" class="item p-20 b-f b-r-20 m-b-20">
			<view class="top f f-a-c f-j-b">
				<view class="left">
					申请时长：{{item.duration}}天
				</view>
				<view class="actHui" :class="{ reviewed:item.status==2,sctRed:item.status==3}">
					{{item.status==1?'待审核':item.status==2?'审核通过':'审核驳回'}}
				</view>
			</view>
			<view class="time m-t-20 m-b-20">
				申请时间：{{item.created_at}}
			</view>
			<view class="time">
				驳回原因：{{item.reason?item.reason:'-'}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				active: 1,
				page: 1,
				list: [],
				total: 0
			}
		},
		onShow() {
			this.initList()
		},
		onReachBottom() {
			if (this.total == list.length) {
				return
			}
			this.page++
			this.initList()
			console.log('123456');
		},
		methods: {
			async initList() {
				let n = await this.$api.RenewalsList({
					page: this.page
				})
				this.total = n.data.total
				this.list = [...this.list, ...n.data.data]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		.top {
			.left {
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Bold;
				font-weight: 700;
				color: #333333;
			}


		}
	}

	.actHui {
		color: #999999 !important;
	}

	.sctRed {
		color: #D62727 !important;
	}

	.reviewed {
		font-size: 26rpx;
		font-family: PingFang SC, PingFang SC-Regular;
		font-weight: 400;
		color: #009d85 !important;
	}
</style>